import { createRouter, createWebHistory } from 'vue-router'

//导入组件
import LoginVue from '@/views/Login.vue'
import LayoutVue from '@/views/Layout.vue'

import UserManageVue from '@/views/view/userManage.vue'



import UserResetPasswordVue from '@/views/user/UserResetPassword.vue'

import ClassManageVue from '@/views/view/classManage.vue'
import TeacherManageVue from '@/views/view/teacherManage.vue'
import  StudentInfoVue from  '@/views/user/studentInfo.vue'
import  HomeVue from '@/views/view/Home.vue'
import  PatriarchInfoVue from '@/views/user/patriarchInfo.vue'
import PatriarchChildVue from  '@/views/user/patriarchChild.vue'
import TeacherInfoVue from '@/views/user/teacherInfo.vue'
import TeacherImproveVue from '@/views/user/TeacherImprove.vue'
import  HomeworkPublishVue from '@/views/view/homework/HomeworkPublish.vue'
import HomeworkListVue from '@/views/view/homework/HomeworkList.vue'
import  InformationPublishVue from '@/views/view/information/InformationPublish.vue'
import  InformationListVue from '@/views/view/information/InformationList.vue'
import  StudentInfoImproveVue from '@/views/user/studentInfoImprove.vue'
import PatriarchInfoImproveVue from  '@/views/user/patriarchInfoImprove.vue'
//定义路由关系
const routes = [
    { path: '/login', component: LoginVue },
    {
        path: '/', component: LayoutVue,redirect:'/Home', children: [
            { path: '/Home', component: HomeVue },
            { path: '/view/category', component: UserManageVue },

            { path: '/user/resetPassword', component: UserResetPasswordVue },

            { path: '/view/class', component: ClassManageVue },
            { path: '/view/teacher', component: TeacherManageVue },
            { path: '/user/student', component: StudentInfoVue },
            { path: '/user/patriarch', component: PatriarchInfoVue },
            { path: '/user/patriarchChild', component: PatriarchChildVue },
            { path: '/user/teacher', component: TeacherInfoVue },
            { path: '/teacher/improve', component: TeacherImproveVue },
            { path: '/student/improve', component: StudentInfoImproveVue },
            { path: '/patriarch/improve', component: PatriarchInfoImproveVue },
            {path:'/homework/publish',component:HomeworkPublishVue },
            {path: '/homework/list', component: HomeworkListVue },
            {path:'/information/publish',component: InformationPublishVue},
            {path:'/information/list',component: InformationListVue},
]
    }

]

//创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes: routes
})

//导出路由
export default router
